package com.design.principle.simpleResponsibility.method;

/**
 * @program: designPattern
 * @description:
 * @author: STU756
 * @create: 2021-01-19 00:27
 */

public class Method {
    private String userName;
    private String address;

    //一个方法可以对userName进行修改还有对address进行修改，同时有两项职责
    public void modifyUserInfo(String userName, String address, boolean flag) {
        if(flag) {
            //修改userName
        }else {
            //修改address
        }
    }

    //可以对上面modifyUserInfo方法职责拆分为两个方法，分别对对应的属性进行修改
    public void modifyUserName(String userName){
        //修改userName
    }
    public void modifyAddress(String address) {
        //修改address
    }
}
